import type { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';

/**
 * @param name 路由名称, 必须设置,且不能重名
 * @param meta 路由元信息（路由附带扩展信息）
 * @param redirect 重定向地址, 访问这个路由时,自定进行重定向
 * @param meta.disabled 禁用整个菜单
 * @param meta.title 菜单名称
 * @param meta.icon 菜单图标
 * @param meta.keepAlive 缓存该路由
 * @param meta.sort 排序越小越排前
 *
 */
const routes: Array<RouteRecordRaw> = [
  {
    path: '/wip',
    name: 'Wip',
    redirect: '/wip/productionCenter',
    component: Layout,
    meta: {
      title: 'wip',
      sort: 2,
      icon: 'wip',
    },
    children: [
      {
        path: 'productionCenter',
        name: 'ProductionCenter',
        meta: {
          title: 'productionCenter',
        },
        component: () => import('@/views/permission/wip/productionCenter/index.vue'),
      },
      {
        path: 'orderReport',
        name: 'OrderReport',
        meta: {
          title: 'orderReport',
        },
        component: () => import('@/views/permission/wip/orderReport/index.vue'),
      },
      {
        path: 'shutdownList',
        name: 'ShutdownList',
        meta: {
          title: 'shutdownList',
        },
        component: () => import('@/views/permission/wip/shutdownList/index.vue'),
      },
      {
        path: 'badRegistration',
        name: 'BadRegistration',
        meta: {
          title: 'badRegistration',
        },
        component: () => import('@/views/permission/wip/badRegistration/index.vue'),
      },
      {
        path: 'badRegistration/add',
        name: 'BadRegistrationAdd',
        meta: {
          title: 'badRegistrationAdd',
          hidden: true,
          activeMenu: 'BadRegistration',
        },
        component: () => import('@/views/permission/wip/badRegistration/add.vue'),
      },
      {
        path: 'badRegistration/edit/:id',
        name: 'BadRegistrationEdit',
        meta: {
          title: 'badRegistrationEdit',
          hidden: true,
          activeMenu: 'BadRegistration',
        },
        component: () => import('@/views/permission/wip/badRegistration/edit.vue'),
      },
      {
        path: 'machineMaintain',
        name: 'MachineMaintain',
        meta: {
          title: 'machineMaintain',
        },
        component: () => import('@/views/permission/wip/machineMaintain/index.vue'),
      },
      {
        path: 'machineMaintain/add',
        name: 'MachineMaintainAdd',
        meta: {
          title: 'machineMaintainAdd',
          activeMenu: 'MachineMaintain',
        },
        component: () => import('@/views/permission/wip/machineMaintain/add.vue'),
      },
      {
        path: 'machineMaintain/edit/:id',
        name: 'MachineMaintainEdit',
        meta: {
          title: 'machineMaintainEdit',
          activeMenu: 'MachineMaintain',
        },
        component: () => import('@/views/permission/wip/machineMaintain/edit.vue'),
      },
      {
        path: 'machineMaintain/check/:id',
        name: 'MachineMaintainCheck',
        meta: {
          title: 'machineMaintainCheck',
          activeMenu: 'MachineMaintain',
        },
        component: () => import('@/views/permission/wip/machineMaintain/check.vue'),
      },
      {
        path: 'alarmRecord',
        name: 'AlarmRecord',
        meta: {
          title: 'alarmRecord',
        },
        component: () => import('@/views/permission/wip/alarmRecord/index.vue'),
      },
    ],
  },
];

export default routes
